﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HSFB.Lib
{
    /// <summary>
    /// Implements IFBWriter based on a stringbuilder
    /// </summary>
    public class FBWriter : IFBWriter
    {
        /// <summary>
        /// String builder property
        /// </summary>
        StringBuilder _sb { get; set; }

        public FBWriter()
        {
            //Initializes Stringbuilder
            _sb = new StringBuilder();
        }

        /// <summary>
        /// Appends a line to string value
        /// </summary>
        /// <param name="value"></param>
        public void WriteLine(string value)
        {
            _sb.AppendLine(value);
        }

        /// <summary>
        /// Reads entire string
        /// </summary>
        /// <returns></returns>
        public string ReadAll()
        {
            return _sb.ToString();
        }
    }
}
